﻿<UserControl x:Class="GSF.TimeSeries.Transport.UI.UserControls.SubscriberStatusUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="650" d:DesignWidth="850"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation"                          
             xmlns:tsfBinding="clr-namespace:GSF.TimeSeries.UI.Binding;assembly=GSF.TimeSeries.UI"
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls;assembly=GSF.TimeSeries.UI.WPF"
             Background="Transparent">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <StackPanel>
        <sdk:DataGrid x:Name="DataGridSubscriberStatus" ItemsSource="{Binding CurrentPage}" VerticalAlignment="Center" Height="615" Width="820" VerticalScrollBarVisibility="Auto">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTemplateColumn Width="*" IsReadOnly="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Ellipse Width="12" Height="12" VerticalAlignment="Center" Fill="{tsfBinding:Column Path=StatusColor, Converter={StaticResource StringToStatusColorConverter}}"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn Header="Acronym" Width="4*" IsReadOnly="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{tsfBinding:Column Path=Acronym}" ToolTip="{tsfBinding:Column Path=Name}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridCheckBoxColumn Header="Enabled" Width="*" IsReadOnly="True" Binding="{tsfBinding:Column Path=Enabled}" CellStyle="{StaticResource CenterAlignCellStyle}"/>
                <sdk:DataGridTemplateColumn Header="Version" Width="9*" IsReadOnly="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{tsfBinding:Column Path=Version}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

        <uc:DataPagerUserControl CurrentPageNumber="{Binding CurrentPageNumber}" PageCount="{Binding PageCount}"
                                FirstCommand="{Binding FirstCommand}" PreviousCommand="{Binding PreviousCommand}"
                                NextCommand="{Binding NextCommand}" LastCommand="{Binding LastCommand}" VerticalAlignment="Bottom"/>
    </StackPanel>
</UserControl>
